<template>
	<div>msg1:<input type="text" v-model="model" /></div>
	<div>msg2:<input type="text" v-model="model2" /></div>
	<div>msg3:<input type="text" v-model="model3" /></div>
</template>

<script setup lang="ts">
const [model, modifiers] = defineModel<string>({
	// 默认值
	default: '',
	// 是否必传
	required: true,
	// 设置值时的处理
	set(val) {
		if (modifiers.toLowerCase) {
			return val.toLowerCase()
		}
		return val
	},
})
const model2 = defineModel('msg2', { default: '', required: true })
const model3 = defineModel('msg3', { default: '', required: true })
</script>

<style lang="sass" scoped></style>
